# 打印菱形
# def diamond1(n):
#     for i in range(n):
#         print(' ' * (n - i - 1) + '*' * (2 * i + 1))
#     for i in range(n - 2, -1, -1):
#         print(' ' * (n - i - 1) + '*' * (2 * i + 1))
#
# diamond1(int(input("请输入你想打印的上半部分行数:")))
for i in range(5):
    print(' '*(5-i-1)+'*'*(2*i+1))
for j in range(3, -1, -1):
    print(' '*(5-j-1)+'*'*(2*j+1))

# 打印水仙花数
# def numbers():
#     for num in range(100, 1000):
#         s = str(num)
#         if num == sum(int(digit)**3 for digit in s):
#             print(num)
# numbers()

# 打印九九乘法表
# def table():
#     for i in range(1, 10):
#         for j in range(1, i + 1):
#             print(f"{j}x{i}={i*j}", end='\t')
#         print()
# table()

# #打印完数
# def numbers1(limit):
#     print("完数:")
#     for num in range(2, limit + 1):
#         divisors = [i for i in range(1, num) if num % i == 0]
#         if sum(divisors) == num:
#             print(num)
# numbers1(int(input("请输入你要打印多少以内的完数:")))


# #打印质数
# def numbers3(limit):
#     print("质数:")
#     for num in range(2, limit + 1):
#         is_prime = True
#         for i in range(2, int(num ** 0.5) + 1):  # 优化: 检查到num的平方根即可
#             if num % i == 0:
#                 is_prime = False
#                 break
#         if is_prime:
#             print(num)
# numbers3(int(input("请输入你要打印多少以内的质数:")))


#打印斐波拉契数
# def numbers4(limit):
#     print("斐波那契数:")
#     a, b = 0, 1
#     while a <= limit:
#         print(a)
#         a, b = b, a + b
# # 打印1000以内的斐波那契数
# numbers4(int(input("请输入你要打印多少以内的斐波拉契数:")))


